﻿using System;
using UnityEngine;

namespace SteeringBehaviors
{
	// Token: 0x0200021E RID: 542
	public class AvoidWall : Seek
	{
		// Token: 0x06000B57 RID: 2903 RVA: 0x0005F530 File Offset: 0x0005D730
		public AvoidWall(MovementCharacter agent, ObstacleDetector obsDetector) : base(agent, null, 0f, 0f)
		{
			this.obstacleDetector = obsDetector;
			this.target = new VectorKinematic(Vector3.zero);
			this.Weight = 1.8f;
			this.zeroSteering = new SteeringOutput();
		}

		// Token: 0x1700015A RID: 346
		// (get) Token: 0x06000B58 RID: 2904 RVA: 0x0005F592 File Offset: 0x0005D792
		public float AvoidDistance
		{
			get
			{
				return this.avoidDistance * this.agent.scale;
			}
		}

		// Token: 0x1700015B RID: 347
		// (get) Token: 0x06000B59 RID: 2905 RVA: 0x0005F5A6 File Offset: 0x0005D7A6
		public float LookAhead
		{
			get
			{
				return this.lookAhead * this.agent.scale;
			}
		}

		// Token: 0x06000B5A RID: 2906 RVA: 0x0005F5BC File Offset: 0x0005D7BC
		public override SteeringOutput GetSteering()
		{
			if (this.obstacleDetector && this.obstacleDetector.CheckObstacle())
			{
				this.target.position = this.obstacleDetector.GetPoint() + this.obstacleDetector.GetNormal() * this.AvoidDistance;
				return base.GetSteering();
			}
			return this.zeroSteering;
		}

		// Token: 0x0400106B RID: 4203
		private SteeringOutput zeroSteering;

		// Token: 0x0400106C RID: 4204
		public float avoidDistance = 10f;

		// Token: 0x0400106D RID: 4205
		public float lookAhead = 5f;

		// Token: 0x0400106E RID: 4206
		public ObstacleDetector obstacleDetector;
	}
}
